﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MotivLogger
{

    [Flags]
    public enum LogLevels { trace, debug, info, warn, error, fatal }
    public abstract class LoggerBase
    {

        
        public static string BuildLogRecord(LogLevels Level, string Message, string Actor)
        {
            DateTime date = DateTime.Now;
            string record = String.Format("[{0}] - {1}: {2} in module {3}", date, Level.ToString(), Message, Actor).ToString();
            return record;
        }

        public abstract void Pause();
        public abstract void Resume();
        public abstract void Stop();

        //Write log
        public abstract void Log(LogLevels Level, string Message, string Actor);

        //Six methods whose names correspond to log levels
        public void Trace(string Message, string Actor) 
        {
            this.Log(LogLevels.trace, Message, Actor);
        }

        public void Debug(string Message, string Actor) 
        {
            this.Log(LogLevels.debug, Message, Actor);
        }

        public void Info(string Message, string Actor) 
        {
            this.Log(LogLevels.info, Message, Actor);
        }

        public void Warn(string Message, string Actor) 
        {
            this.Log(LogLevels.warn, Message, Actor);
        }

        public void Error(string Message, string Actor) 
        {
            this.Log(LogLevels.error, Message, Actor);
        }

        public void Fatal(string Message, string Actor) 
        {
            this.Log(LogLevels.fatal, Message, Actor);
        }
    }
}
